<template>
    <div class="bgc8 page-buysucc">
        <div class="my-container flex-bt pt38 pb38">
            <div class="flex">
                <div>
                    <i class="fa fa-check-circle fz64 clr10" aria-hidden="true" />
                </div>
                <div class="ml20">
                    <div class="fz24 clr3">已成功加入购物车！</div>
                    <div class="fz12 clr5"> {{product}} </div>
                </div>
            </div>
            <div class="flex">
                <nuxt-link to="" @click.prevent="back()" class="btn3 w180 h38 lh38 fz14 mt5"> 返回上一级 </nuxt-link>
                <nuxt-link to="/buy/cart" class="btn1 w180 h38 lh38 fz14 mt5 ml12"> 去购物车结算 </nuxt-link>
            </div>
        </div>
    </div>
</template>

<script>
    import { myTools } from "assets/MyTools/Tools"

    export default {
        name: 'BuySuccess',
        data() {
            return {
                product: ''
            }
        },
        beforeMount() {
            const list = myTools.getSession('cart')
            const obj = list[list.length - 1]
            this.product = obj.edition.desc + ' ' + obj.edition.title
        },
        methods: {
            back: function () {
                myTools.historyTo(-1)
            }
        }
    }
</script>

<style scoped lang="stylus">
.page-buysucc
  @media screen and (max-width: 1228px)
    width: 1228px
</style>
